package com.spring.sunflower.main.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.spring.sunflower.R;
import com.spring.sunflower.bean.NewestBean;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;

/**
 * Created by Kevin on 2021/6/2<br/>
 * <p>
 * Describe:<br/>
 */
public class NewestAdapter extends BaseQuickAdapter<NewestBean.DatasBean, BaseViewHolder> {
    public NewestAdapter(int layoutResId, @Nullable List<NewestBean.DatasBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, NewestBean.DatasBean datasBean) {
        Glide.with(getContext())
                .load(datasBean.getPhoto())
                .into((ImageView) baseViewHolder.getView(R.id.ivCover));
        baseViewHolder.setText(R.id.tvName, datasBean.getNickname());
        baseViewHolder.setText(R.id.tvAge, datasBean.getAge()+"岁");
        baseViewHolder.setText(R.id.tvHouse, datasBean.getCity());
        baseViewHolder.setText(R.id.tvMark, datasBean.getSignature());
    }
}
